<!--报名统计页面-->
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">报名统计</h3>
    </div>
    <div class="panel-body">
        <div id="statisticsContainer" style="width: 100%; height: 800px; border: 1px solid #ddd;">
            <iframe id="statisticsFrame" 
                    src="" 
                    width="100%" 
                    height="100%" 
                    frameborder="0"
                    style="min-height: 800px;">
            </iframe>
        </div>
    </div>
</div>

<script>
$(function() {
    // 获取移动端统计页面URL
    $.ajax({
        url: '{:url("enrollmentstatistics/getStatisticsUrl")}',
        type: 'GET',
        dataType: 'json',
        success: function(response) {
            if (response.code === 1 && response.data && response.data.url) {
                $('#statisticsFrame').attr('src', response.data.url);
            } else {
                layer.msg('获取统计页面URL失败');
            }
        },
        error: function() {
            layer.msg('请求统计页面URL失败');
        }
    });
    
    // 自适应高度
    function adjustFrameHeight() {
        var windowHeight = $(window).height();
        var panelHeadingHeight = $('.panel-heading').outerHeight() || 50;
        var padding = 40; // 上下边距
        var newHeight = windowHeight - panelHeadingHeight - padding;
        
        $('#statisticsContainer, #statisticsFrame').height(newHeight);
    }
    
    // 页面加载完成后调整高度
    adjustFrameHeight();
    
    // 窗口大小改变时重新调整高度
    $(window).resize(function() {
        adjustFrameHeight();
    });
});
</script>